package Oct_2020.part1;

public class Employee extends person implements Comparable<Employee>{
    private String Name;
    private boolean Sex;
    private int Age;
    private double Salary;

    public Employee(String name,boolean sex,int age,double salary){
        Name=name;
        Sex=sex;
        Age=age;
        Salary=salary;
    }
//    一个方法
    public double RaiseSalary(double rate){
        Salary=Salary*(1+rate);
        return  Salary;
    }
//    获得数据


    public double getSalary() {
        return Salary;
    }

    public String getName() {
        return Name;
    }

    public int getAge() {
        return Age;
    }

    public String getDescription() {
        return "Employee";
    }
//    比较工资大小
    @Override
    public int compareTo(Employee e) {
        return Double.compare(e.getSalary(),Salary);
    }

}
